<!DOCUMENT HTML>
<html>
    <head><title> Fotos</title>
        
        <link rel="stylesheet" type="text/css" href="css/album.css">

    </head>

    <body>
     <h1>Lista de Fotos</h1><br>
    <?php 
       session_start();
       require 'checksLogged.php';
       include ('menu.php');
      ?>

<?php
include 'action/listAllPhotosAction.php';


if(isset($allPhotos)){
if ($allPhotos) {
    if ($albumlist) {
        //$iterator = new DirectoryIterator('uploads');
        //echo 'name:'. $albumlist2->getNameAlbum();


        $i = 0;


        foreach ($allPhotos as $valuee) {
            $album = $albumlist[$i]->getNameAlbum();
            $direcotory = $albumlist[$i]->getDirectory();
            $user=$albumlist[$i]->getNameUser();

            $i++;


            foreach ($valuee as $key => $value) {
                ?>


                        <ul class="fotos">
                            <li> 
                                <a href="visualizePhoto.php?id=<?php echo $value->getId(); ?>">
                                     <img src="<?php echo $direcotory .$user.'/'. $album . "/" . $value->getName_photo(); ?>"  

                                </a>
                            </li> 


                        </ul>

                <?php
            }
        }
    }
    else
        echo"Nem um registro encontrado.";
}
else
    echo"Nem um registro encontrado.";

}
?>

    </body>

</html>
